<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>文本缩进</title>
    <style>
        .indent-2 {
            /*文本首行缩进对应px，可正可负*/
            text-indent: 20px;
        }

        .indent-2rem {
            /*rem为相对单位，大小为当前文字*/
            text-indent: 2rem;
        }

    </style>
</head>
<body>
<div class="indent-2">首行缩进20px</div>
<div class="indent-2rem">首行缩进2rem</div>
</body>
</html>